home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Papers / C++ Exceptions / µShell / Core Utilities / Debugging / Debugger.h < prev    next >
Encoding:
Text File  |  1998-04-02  |  1.9 KB  |  81 lines  |  [TEXT/CWIE]

  1. // UDebug.h
  2. // Copyright 1984-1994 Apple Computer, Inc.All rights reserved.
  3.  
  4. #ifndef __DEBUGGER__
  5. #define __DEBUGGER__
  6. #pragma once
  7.  
  8. #ifndef __STDDEF__
  9. #include <stddef.h>
  10. #endif
  11.  
  12. #ifndef qDebug
  13. #define qDebug            1
  14. #endif
  15.  
  16. #ifndef qTheDebugger
  17. #define qTheDebugger    1
  18. #endif
  19.  
  20. #ifndef qPerform
  21. #define qPerform        0
  22. #endif
  23.  
  24. #ifndef qAppleANSI
  25. #    ifdef __STDDEF__
  26. #        define qAppleANSI    1
  27. #    else
  28. #        define qAppleANSI    0
  29. #    endif
  30. #endif
  31.  
  32. //----------------------------------------------------------------------------------------
  33. // Global function declarations
  34. //----------------------------------------------------------------------------------------
  35.  
  36. #if qDebug || qTheDebugger
  37.  
  38.     extern bool gHighLevelDebuggerRunning;
  39.  
  40.     extern bool ConfirmHighLevelDebugger();
  41.  
  42.     inline bool    HaveHighLevelDebugger()    { return gHighLevelDebuggerRunning != false;    }
  43.  
  44.     extern void InitializeDebugger();
  45.  
  46.     extern void FinalizeDebugger();
  47.  
  48.     extern bool DebugCanReadLn();
  49.         // Returns true if you can ReadLn to the user. This in turn is true when there is a
  50.         // debug view (pDebugView), that view can currently write to its window, and this unit
  51.         // is initialized.
  52.  
  53.     extern bool DebugCanWriteLn();
  54.         // Returns true if you can WriteLn to the user in the debug window. This is true if
  55.         // there exists a debug view and this unit is initialized.
  56.  
  57.     extern void ShowSegments();
  58.         // Write a list of the loaded segments out to the debugger.
  59.  
  60.     extern void    DebugWriteLnHook(char* textBuf, long byteCount);
  61.         // Wrtie a block of text to the debugger
  62.  
  63. #else
  64.  
  65.     inline    void    InitializeDebugger() { }
  66.     inline    void    FinalizeDebugger() { }
  67.  
  68.     inline bool    HaveHighLevelDebugger()    { return false; }
  69.  
  70.     inline bool    HaveLowLevelDebugger()    { return false; }
  71.  
  72.     inline bool    DebugCanReadLn()        { return false; }
  73.  
  74.     inline bool    DebugCanWriteLn()        { return false; }
  75.  
  76.     inline void    DebugWriteLnHook(char* /*textBuf*/, long /*byteCount*/) {}
  77.  
  78. #endif
  79.  
  80. #endif    // __DEBUGGER__
  81.